package com.atguigu.chapter05;

import com.atguigu.chapter02.Event;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.ArrayList;

public class SourceCollectionTest {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment().setParallelism(1);
        ArrayList<Event> clicks = new ArrayList<>();
        clicks.add(new Event("Marry","./home",1000L));
        clicks.add(new Event("Bob","./cart",2000L));

        DataStreamSource<Event> stream = env.fromCollection(clicks);

        stream.print("CollectionSource1");

        env.execute();



    }
}
